package com.anycl.design.j2ee.interceptingfilter.instance;

import lombok.extern.slf4j.Slf4j;

import java.util.Random;

@Slf4j
public class IpFilter implements Filter {
    @Override
    public void doFilter(FilterChain filterChain) {
        log.info("IP过滤器");
        if (new Random().nextBoolean()){
            filterChain.execute();
        } else {
            log.info("IP被拦截");
        }
    }
}
